.segmented {
    --bb-segmented-padding: 2px;
    --bb-segmented-bg: #f5f5f5;
    --bb-segmented-item-padding: 0 11px;
    --bb-segmented-item-height: 28px;
    --bb-segmented-item-font-size: 0.875rem;
    --bb-segmented-item-selected-bg: #fff;
    --bb-segmented-item-border-radius: 6px;
    --bb-segmented-item-lg-height: 36px;
    --bb-segmented-item-lg-padding: 0 11px;
    --bb-segmented-item-lg-font-size: 1rem;
    --bb-segmented-item-lg-border-radius: 8px;
    --bb-segmented-item-sm-height: 20px;
    --bb-segmented-item-sm-padding: 0 7px;
    --bb-segmented-item-sm-font-size: .75rem;
    --bb-segmented-item-sm-border-radius: 4px;
    --bb-segmented-text-margin-left: 4px;
    padding: var(--bb-segmented-padding);
    background-color: var(--bb-segmented-bg);
    border-radius: var(--bs-border-radius);
    display: inline-flex;
    position: relative;

    &.segmented-lg {
        --bb-segmented-item-border-radius: var(--bb-segmented-item-lg-border-radius);
        --bb-segmented-item-height: var(--bb-segmented-item-lg-height);
        --bb-segmented-item-padding: var(--bb-segmented-item-lg-padding);
        --bb-segmented-item-font-size: var(--bb-segmented-item-lg-font-size);
    }

    &.segmented-sm {
        --bb-segmented-item-border-radius: var(--bb-segmented-item-sm-border-radius);
        --bb-segmented-item-height: var(--bb-segmented-item-sm-height);
        --bb-segmented-item-padding: var(--bb-segmented-item-sm-padding);
        --bb-segmented-item-font-size: var(--bb-segmented-item-sm-font-size);
    }

    &.block {
        display: flex;

        .segmented-item {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }

    .segmented-item {
        padding: var(--bb-segmented-item-padding);
        text-align: center;
        cursor: pointer;
        border-radius: var(--bb-segmented-item-border-radius);
        line-height: var(--bb-segmented-item-height);
        font-size: var(--bb-segmented-item-font-size);
        position: relative;
        transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
        white-space: nowrap;

        &.mask {
            background-color: var(--bb-segmented-item-selected-bg);
            box-shadow: 0 1px 2px 0 rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02), 0 2px 4px 0 rgba(0,0,0,.02);
            pointer-events: none;
            position: absolute;
            left: 0;
            transition: all .3s ease-in-out;
            visibility: hidden;
        }

        &.selected {
            background-color: var(--bb-segmented-item-selected-bg);
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
        }

        &.disabled {
            color: rgba(0, 0, 0, 0.25);
            cursor: not-allowed;
        }

        &:hover:not(.selected):not(.disabled):not(.moving):after {
            background-color: rgba(0,0,0,.06);
        }

        &:active:not(.selected):not(.disabled):not(.moving):after {
            background-color: rgba(0,0,0,.15);
        }

        &:after {
            content: "";
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            border-radius: inherit;
            transition: background-color 0.2s;
            pointer-events: none;
        }

        .segmented-item-icon + span {
            margin-left: var(--bb-segmented-text-margin-left);
        }

        .flex-column {
            --bb-segmented-text-margin-left: 0;
        }
    }
}
